<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
	<div id="moduleHtml">
		<div id="sidebarContainer">
		  <div id="datePanel">yyyy年MM月dd日</div>
		  <div id="timePanel">hh : mm : ss</div>
      <div id="calendarPanel">
        <div id="canldarDom"></div>
      </div>		  
      <div id="buttonPanel">
        <div id="explorerButton">我的文件</div>
        <div id="noteButton">我的便签</div>
      </div>
	  </div>
	</div>
</body>
  <script>
  //cofit_module_js
    Cofit.moduleSourceCode.side_bar=function(dom){
	  
      var module = {
        dom : $(dom) ,        
        //显示
        show : function(){
	          var dom=$(module.dom);
	          $("body").append(dom);
	          $(window).resize(module.resize);
	          var containter=dom.find("#sidebarContainer");
	          
	          //更新时间
	          var updateTime=function(){
	        	  var date=new Date();
	        	  containter.find("#datePanel").html(date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日");
	        	  var h=date.getHours();
	        	  var m=date.getMinutes();
	        	  var s=date.getSeconds();
	        	  containter.find("#timePanel").html( (h<10?("0"+h):h) +" : "+(m<10?("0"+m):m)+" : "+(s<10?("0"+s):s));
	        	  
	        	  setTimeout(updateTime,500);
	          };
	          updateTime();
	          
	          containter.find("#explorerButton").click(function(){
	        	  Cofit.load("file_explorer",function(module){
	                    module.show();
	                  });
	          });
	          containter.find("#noteButton").click(function(){
	        	  Cofit.load("note_explorer",function(module){
	                    module.show();
	                  });
	          });
	          
	          containter.fadeOut(0,function(){
		          module.resize();	          
		          containter.fadeIn("normal",function(){
			          module.resize();	          
	              containter.find("#canldarDom").calendar({
	                  fit : true ,
	                  border : false
	                });
		          });
	          });
	          
        },
        //跟随窗口尺寸        
        resize : function(){
          var dom=$(module.dom);
          var containter=dom.find("#sidebarContainer");
          
          
        }
      };
      return module;
    };
  //cofit_module_js
  </script>
</html>